home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-06-28 | 579 b | 37 lines | [TEXT/CWIE] |
- // FinitePool.h
-
- #ifndef FinitePool_h
- #define FinitePool_h
-
- #ifndef FinitePoolBase_h
- #include "FinitePoolBase.h"
- #endif
- #ifndef AlignedBlock_h
- #include "AlignedBlock.h"
- #endif
- #ifndef BitArray_h
- #include "BitArray.h"
- #endif
-
- template < class Element, uint32 size >
- class FinitePool: public FinitePoolBase
- {
- private:
- AlignedBlock< size * sizeof( Element ) > space;
- BitArray< size > map;
-
- public:
- FinitePool()
- : FinitePoolBase( space, map, size )
- {}
-
- void Delete( Element *p )
- {
- Assert( p != 0 );
- p->~Element();
- Release( p );
- }
- };
-
- #endif
-